package com.baizhi.springmvc.util;


import java.io.FileWriter;
import java.io.IOException;

/**
 * Created by 86176 on 2019/9/7.
 */
public class AlipayConfig {
    //↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2016101600699764";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key ="MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCr+VnmrxbPyR1vDKgDg8P+1vtrBeMS3PE0jxlaGm5pfn3+3RelywLIAXKU3TA6NNs19sj2JGx1etGneX1q8+qBceAVpL8H/vEtUurRd3yNTlVAkdpfCp/LAjEBksyFW3L0dp6HA4iyo+kJcK9iMda/wYbiS/zDPDFGsMXonJA1/by7vEG4ce3338JGbMp6Oa8slmUhMWmKBGcps+nDT08UsBCHeUTZe0Zx2OHojIjDIO/qiLZkETweL6BTdpnm7vVupqEoUHvtjK1m8IW16HCkOcOBMSsPqOMc3fJXi1gw3LY/Ls9WI59QAUI38mTD3+AYZ5k5wZJQh/rbx8MVoJ5zAgMBAAECggEBAILvpR1YbfviWkC02C9k4ZNkR6SipNM12Yh0846A1VQI9RFZcKnQudtiDsV86z1GBSk/Lp8J+HIyAvKKM419DS1lcIHKH5CM8T/bA+JcIT7NR2eUJTl7s1Iz5vAVvxZCHHI45lZRwICS/9kqLL6Mx77UMEiYJmjXqYTzDpweqEYSHV2/tGcf4PI3GTXYkdMP7tdTGtvC7BUYfzW5RS4sgjzC85FvrVPZfVOV2kHzbjH1e4pCDD70cCfQ4tMSVmInHwV0Jzo8HmkpyY9QRGxYQ+Wpq6rFt4hi4KxURtIv97XCQZKZ4rtHZ6LV4AERKbrcURVSxee3CECfTLGSCyDn9mECgYEA02lHAPe7iyIKI+py+ycsiTTtkZ7eT6CcQ84av9zjftlxHSR8nj9CbO0zeYkMeGE5b+s67sWbFhqfOlQEhWfc1oU2IvrXKLLD+bUcqscCx4BwyplPpw6sh9R8fjGI2X3NupFJSs2Um67M9Wyr9wM5XaZb57mLGMBf77olnV9Ii1kCgYEA0D69xCPHwemgp5Q6NYu0BbibOCIzihWL3Xguy1FSNdQjUPwinMEd+GNFgoTXZN/EPFkpMmt98OwsjmfVmohMQ3AWbd77LITQy0oEwpn0Hfs8boZK17EFLPAsPq/HfB127gcg3tA7BhSxj6ZCCG+b/gzvaG4jc4VtAB3viBwYmqsCgYBYRy+1Ab04XeBqGu4kXblFGerR0cr26RQXZCrbTvtX7qhDCQdYdQXhwjKqX0Xrxn1bdJhJOA6Ibllq28Z/hl063qk6dg/+GJeo3622yh8o+0Md9mLCWWhF176cW0bPuq57Z0t5htq1H4rKOLSeEqSTrHHYEyw4C6yDx/EJA86hEQKBgHMgvLkbLuy9xNvgzu2bdsNS9D1sayIEF3cxYm11YAXyajPzsQ8IlRElkOA/oPVb4JmckXIWi2IOr/Nq5GSyxbbi2QOVKzfJlcVN/qO3iYapxxczl1z3uOzHOy7M73RmtcGSn1GPvZH3DtNkD02qposli5YojeDn+wL9idet8MxRAoGAR351/e467ejuFsje1l32CdEEBxmzku+S8epchQOZRp5+wqZUShbuUebrW+g0nAr/dZ4Gzb7bffQnOJybj20k+30JRTaZLb04IYmMlOHLySWdmSGl4uigaQ21bcrVgl/1/EVDY0WpFu0h3yA8ogjkbGofYs1bD40o/o27U4t85Ng=";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAq/lZ5q8Wz8kdbwyoA4PD/tb7awXjEtzxNI8ZWhpuaX59/t0XpcsCyAFylN0wOjTbNfbI9iRsdXrRp3l9avPqgXHgFaS/B/7xLVLq0Xd8jU5VQJHaXwqfywIxAZLMhVty9HaehwOIsqPpCXCvYjHWv8GG4kv8wzwxRrDF6JyQNf28u7xBuHHt99/CRmzKejmvLJZlITFpigRnKbPpw09PFLAQh3lE2XtGcdjh6IyIwyDv6oi2ZBE8Hi+gU3aZ5u71bqahKFB77YytZvCFtehwpDnDgTErD6jjHN3yV4tYMNy2Py7PViOfUAFCN/Jkw9/gGGeZOcGSUIf628fDFaCecwIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://localhost:8081/zhifu/success.jsp";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://localhost:8081/order/order_updateOrderStatus";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
